package com.blog.controller;

import com.blog.dto.Result;
import com.blog.service.TagService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/public/tag")
public class TagController {
    @Resource
    private TagService tagService;

    @GetMapping("/page/{tagId}")
    public Result get_category_page_list(@PathVariable Integer tagId,
                                         @RequestParam(defaultValue = "1") Integer pageNum,
                                         @RequestParam(defaultValue = "5") Integer pageSize) {
        return tagService.get_tag_page_list(tagId,pageNum,pageSize);
    }

    @GetMapping("/tagname/{tagId}")
    public Result get_tag_name(@PathVariable Integer tagId) {
        return tagService.get_tag_name(tagId);
    }

    @GetMapping("/list")
    public Result get_tag()
    {
        return tagService.get_tag();
    }
}